home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
TPUG Xtras
/
Xtras
/
progdisk.d64
/
moveman
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2009-02-07
|
5KB
|
166 lines
10 FORK=0TO10:READDR(K):NEXT
20 FORI=12800TO13631:READX:POKEI,X:NEXT
30 PRINT"[144]":GOSUB 930
40 PRINT"[144]":PRINTCHR$(9)CHR$(142)CHR$(8)
50 PRINT"[147]":X=100:Y=100:GOSUB850
60 DATA0,145,17,0,157,0,0,0,29,0,0
70 POKE 808,225
80 :
90 PRINT"";
100 PRINT"READY > ";
110 B$="":GETB$:IFB$=""THEN350
120 B=ASC(B$):IFB=148ORB=20ORB=19ORB=147THEN110
121 IF B=3 THEN 2000
130 IFB$=CHR$(145)ORB$=CHR$(17)ORB$=CHR$(29)ORB$=CHR$(157)ORB$=CHR$(13)THEN780
140 W$=B$:PRINTB$;
150 B$="":GETB$:IFB$=""THEN150
160 :
170 :
180 IFB$=CHR$(20)THENPRINTB$;:W$=LEFT$(W$,LEN(W$)-1):GOTO150
190 IFB$<>CHR$(13)THENW$=W$+B$:PRINTB$;:GOTO150
200 IFW$="RIGHT"THENY=Y+5:GOSUB430:GOTO320
210 IFW$="LEFT"THENY=Y-5:GOSUB510:GOTO320
220 IFW$="UP"THENX=X-5:GOSUB590:GOTO320
230 IFW$="DOWN"THENX=X+5:GOSUB670:GOTO320
240 IFW$="END"THENPRINT"[147]":END
250 PRINT"I DON'T UNDERSTAND.":FORI=1TO1500:NEXT:GOTO320
260 :
270 :
280 PRINT" ";
290 PRINT" ";:RETURN
300 :
310 :
320 GOSUB280:W$="":GOTO100
330 :
340 :
350 JV=PEEK(56320):FR=JVAND16:JV=15-(JVAND15)
360 IFDR(JV)=0THEN110
370 B$=CHR$(DR(JV)):GOTO780
380 :
390 :
400 IFY>255THENY=Y-255:POKEV+16,255
410 IFY>38ANDPEEK(V+16)>0THENY=38
420 RETURN
430 GOSUB400:S1=200:S2=206:S3=207:GOSUB720:Y=Y+5:GOSUB400
440 FORT=1TO200:NEXT:S1=204:S2=207:S3=206:GOSUB720
450 RETURN
460 :
470 :
480 IFY<30ANDPEEK(V+16)=0THENY=30
490 IFY<0THENY=Y+255:POKEV+16,0
500 RETURN
510 GOSUB480:S1=201:S2=209:S3=208:GOSUB720:Y=Y-5:GOSUB480
520 FORT=1TO200:NEXT:S1=205:S2=208:S3=209:GOSUB720
530 RETURN
540 :
550 :
560 IFX<60THENX=60
570 IFX>170THENX=170
580 RETURN
590 GOSUB560:S1=203:S2=210:S3=212:GOSUB720:X=X-5:GOSUB560
600 FORT=1TO200:NEXT:S1=203:S2=211:S3=212:GOSUB720
610 RETURN
620 :
630 :
640 IFX<60THENX=60
650 IFX>170THENX=170
660 RETURN
670 GOSUB640:S1=202:S2=210:S3=212:GOSUB720:X=X+5:GOSUB640
680 FORT=1TO200:NEXT:S1=202:S2=211:S3=212:GOSUB720
690 RETURN
700 :
710 :
720 POKEV+21,0:POKE2040,S1:POKE2041,S2:POKE2042,S3
730 POKEV,Y:POKEV+1,X
740 POKEV+2,Y:POKEV+4,Y:POKEV+3,X+42:POKEV+5,X+42:POKEV+21,7
750 RETURN
760 :
770 :
780 IFB$=CHR$(29)THENY=Y+5:GOSUB430:GOTO320
790 IFB$=CHR$(157)THENY=Y-5:GOSUB510:GOTO320
800 IFB$=CHR$(145)THENX=X-5:GOSUB590:GOTO320
810 IFB$=CHR$(17)THENX=X+5:GOSUB670:GOTO320
820 IFB$=CHR$(13)THEN250
830 :
840 :
850 V=53248:POKEV+29,255:POKEV+23,255:POKEV+28,255:POKEV+16,0
860 X=100:Y=100
870 POKE2040,202:POKE2041,210:POKE2042,212:POKEV,X:POKEV+1,Y
880 POKEV+2,X:POKEV+4,X:POKEV+3,Y+42:POKEV+5,Y+42
890 POKEV+21,7
900 RETURN
910 :
920 :
930 POKE53280,6:POKE53281,1:PRINT"[147]"
940 PRINTTAB(12)" [146]"
950 PRINTTAB(12)" MOVE THE MAN [146]"
955 PRINTTAB(12)" [146]"
960 PRINT"[151] DO THIS SIMPLE DEMONSTRATION SHOWING"
970 PRINT" THREE OF THE WAYS THE COMPUTER MOVES"
990 PRINT" GRAPHIC OBJECTS ON THE SCREEN."
1000 PRINTTAB(7)"1. USE THE CURSOR CONTROLS"
1010 PRINTTAB(7)"2. TYPE ANY ONE COMMAND:"
1015 PRINTTAB(11)"UP DOWN"
1016 PRINTTAB(11)"LEFT RIGHT"
1018 PRINTTAB(11)"(AND PRESS RETURN)"
1020 PRINTTAB(7)"3. USE THE JOYSTICK"
1030 PRINTTAB(7)"PRESS THE F1 KEY TO START"
1040 PRINTTAB(9)"PRESS RUN/STOP TO END";
1050 GET A$:IF A$<>"[133]" THEN 1050
1060 RETURN
2000 POKE908,0:POKE53269,0:POKE 808,237
2010 POKE 53269,0
2020 STOP
10000 DATA 3,255,0,3,255,0,63,255,240,3,183,0,3,191,0,3
10010 DATA 255,0,3,245,0,3,255,0,0,252,0,0,252,0,15,255
10020 DATA 0,15,255,192,15,15,192,12,15,192,12,63,192,0,63,192
10030 DATA 32,255,192,160,255,224,175,255,224,15,255,192,15,255,192,0
10040 DATA 3,255,0,3,255,0,63,255,240,3,123,0,3,251,0,3
10050 DATA 255,0,1,127,0,3,255,0,0,252,0,0,252,0,3,255
10060 DATA 192,15,255,192,15,15,192,15,3,192,15,192,192,15,240,0
10070 DATA 15,252,32,47,255,40,47,255,232,15,255,192,15,255,192,0
10080 DATA 3,255,0,3,255,0,63,255,240,11,119,128,11,255,128,3
10090 DATA 255,0,3,223,0,3,255,0,0,252,0,0,252,0,95,255
10100 DATA 212,95,255,212,95,255,212,95,255,212,95,255,212,95,255,212
10110 DATA 95,255,212,95,255,212,175,255,232,175,255,232,15,255,192,0
10120 DATA 3,255,0,3,255,0,63,255,240,11,255,128,11,255,128,3
10130 DATA 255,0,3,255,0,3,255,0,0,252,0,0,252,0,95,255
10140 DATA 212,95,255,212,95,255,212,95,255,212,95,255,212,95,255,212
10150 DATA 95,255,212,95,255,212,175,255,232,175,255,232,15,255,192,0
10160 DATA 3,255,0,3,255,0,63,255,240,3,183,0,3,191,0,3
10170 DATA 255,0,3,245,0,3,255,0,0,252,0,0,252,0,3,255
10180 DATA 192,15,255,192,15,15,192,15,3,192,15,192,192,15,240,0
10190 DATA 15,252,32,47,255,40,47,255,232,15,255,192,15,255,192,0
10200 DATA 3,255,0,3,255,0,63,255,240,3,123,0,3,251,0,3
10210 DATA 255,0,1,127,0,3,255,0,0,252,0,0,252,0,15,255
10220 DATA 0,15,255,192,15,15,192,12,15,192,12,63,192,0,63,192
10230 DATA 32,255,192,160,255,224,175,255,224,15,255,192,15,255,192,0
10240 DATA 3,80,0,0,212,0,0,212,0,0,212,0,0,53,0,0
10250 DATA 53,0,0,53,0,0,21,64,0,5,64,0,5,64,0,5
10260 DATA 64,0,1,80,0,3,252,0,3,252,0,0,0,0,0,0
10270 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10280 DATA 1,80,0,5,64,0,5,64,0,5,64,0,21,0,0,21
10290 DATA 0,0,21,0,0,21,0,0,84,0,0,84,0,0,84,0
10300 DATA 0,84,0,0,255,0,0,255,0,0,0,0,0,0,0,0
10310 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10320 DATA 0,21,0,0,5,64,0,5,64,0,5,64,0,1,80,0
10330 DATA 1,80,0,1,80,0,0,84,0,0,84,0,0,84,0,0
10340 DATA 84,0,0,21,0,0,255,0,0,255,0,0,0,0,0,0
10350 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10360 DATA 0,92,0,1,92,0,1,92,0,1,112,0,5,192,0,5
10370 DATA 192,0,5,192,0,5,64,0,21,0,0,21,0,0,21,0
10380 DATA 0,21,0,0,255,0,0,255,0,0,0,0,0,0,0,0
10390 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10400 DATA 5,69,64,5,69,64,5,69,64,5,69,64,5,69,64,5
10410 DATA 69,64,5,69,64,5,69,64,5,69,64,5,79,192,5,79
10420 DATA 192,5,64,0,15,192,0,15,192,0,0,0,0,0,0,0
10430 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10440 DATA 5,69,64,5,69,64,5,69,64,5,69,64,5,69,64,5
10450 DATA 69,64,5,69,64,5,69,64,5,69,64,15,197,64,15,197
10460 DATA 64,0,5,64,0,15,192,0,15,192,0,0,0,0,0,0
10470 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10480 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10490 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10500 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10510 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0